package inter;

public class SeqStmts extends Stmt {
	
	Stmt stmt1, stmt2;

	public SeqStmts(Stmt stmt1, Stmt stmt2) {
		super();
		this.stmt1 = stmt1;
		this.stmt2 = stmt2;
	}
	
	public void gen(int b, int a){
		if(stmt1 == null) stmt2.gen(b, a);
		else if(stmt2 == null) stmt1.gen(b, a);
		else{
			int label = newLabel();
			stmt1.gen(b, label);
			emitLabel(label);
			stmt2.gen(label, a);
		}
	}

}
